<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Using the compatibility language dialect
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot135.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot137.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc298">22.1</A>&nbsp;&nbsp;Using the compatibility language dialect</H2><UL>
<LI><A HREF="umsroot136.html#toc164">Compiler versus Interpreter</A>
</UL>

The ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> compatibility language dialects are the fastest way to get a
program running that was originally written for a different system.
To use a particular language dialect, a module
should be created with that language dialect using <A HREF="../bips/kernel/modules/module-3.html"><B>module/3</B></A><A NAME="@default1177"></A>.
The packages contain the necessary code to make ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> emulate
the behaviour of the other system to a large extent within the module.
Compatibility dialects exist for:
<UL CLASS="itemize"><LI CLASS="li-itemize">
ISO Standard Prolog (module(mymodulename, [], iso))
<LI CLASS="li-itemize">C-Prolog (module(mymodulename, [], cprolog))
<LI CLASS="li-itemize">Quintus Prolog (module(mymodulename, [], quintus))
<LI CLASS="li-itemize">SICStus Prolog, (module(mymodulename, [], sicstus))
</UL>
See the Reference Manual for details on the compatibility provided by the
language dialects. 
The language dialects are just modules which provides the necessary code
and exports to emulate a particular Prolog dialect. This module is imported
instead of the default eclipse_language dialect which provides the
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> language. 
The source code of the language dialect module is provided in the
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> library directory.
Using this as a guideline, it should be easy to write similar packages for
other systems, as long as their syntax does not deviate too much
from the Edinburgh tradition. <BR>
<BR>
The following problems can occur despite the use of compatibility packages:<BR>
<BR>
<A NAME="toc164"></A>
<H3 CLASS="subsection"><A NAME="htoc299">22.1.1</A>&nbsp;&nbsp;Compiler versus Interpreter</H3>
If your program was written for an interpreter, e.g. C-Prolog,
you have to be aware that ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> is a compiling system.
There is a distinction between <I>static</I> and <I>dynamic</I> predicates.
By default, a predicate is static. This means that its clauses have to be
be compiled as a whole (they must not be spread over multiple files),
its source code is not stored in the system, 
and it can not be modified (only recompiled as a whole).
In contrast, a dynamic predicate may be modified by compiling or
asserting new clauses and by retracting clauses.
Its source code can be accessed using <A HREF="../bips/kernel/dynamic/clause-1.html"><B>clause/1,2</B></A><A NAME="@default1178"></A> or <A HREF="../bips/kernel/dynamic/listing-0.html"><B>listing/0,1</B></A><A NAME="@default1179"></A>
A predicate is dynamic when it is explicitly declared as such or when
it was created using <A HREF="../bips/kernel/dynamic/assert-1.html"><B>assert/1</B></A><A NAME="@default1180"></A>.
Porting programs from an interpreter usually requires the addition of
some <B>dynamic</B> declarations.
In the worst case, when (almost) all procedures have to be dynamic,
the flag <B>all_dynamic</B> can be set instead.<BR>
<BR>
<HR>
<A HREF="umsroot135.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot137.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
